import { getCurrentInstance } from "vue";

export function getProxy(){
    const { proxy } = getCurrentInstance();
    const modules = import.meta.globEager('@/store/modules/*.js');
    const keys = Object.keys(modules)
    let store = {}
    keys.forEach(key => {
        const tag = key.replace('/src/store/modules/', '').replace('.js', '')
        store[tag] = modules[key].default()
    })
    proxy['$store'] = store
    return {
        proxy
    };
}